package com.springCloud.listener;

import com.springCloud.config.RabbitMQConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName MQListener
 * @Author 1628994918qq.com
 * @Date 2023/3/10 15:52
 */
@Component
@RabbitListener(queues = {RabbitMQConfig.RABBITMQ_DEMO_TOPIC})
public class MQListener {

    @RabbitHandler
    public void consumer(Map msg){
        System.out.println("消费者消费RabbitMQ的消息：" + msg);
    }
}
